%'登录判断 if request("type")="login" then username=trim(request.form("username")) password=trim(request.form("password")) if username<>"" and password<>"" then set rsu=server.createobject("adodb.recordset") stru="select username from [web_register] where username='"&username&"'" rsu.open(stru),cn,1,1 if not rsu.eof and not rsu.bof then set rs=server.createobject("adodb.recordset") str="select id,username,check_yes,login_time,login_times from [web_register] where username='"&username&"' and password='"&md5(password,16)&"'" rs.open(str),cn,1,3 if not rs.eof and not rs.bof then if rs("check_yes")=1 then session("login_time")=rs("login_time") rs("login_time")=now() rs("login_times")=rs("login_times")+1 rs.update response.cookies("username")=rs("username") response.cookies("username").expires=date()+1 session("common_name")=rs("username") session("common_id")=rs("id") session("login_times")=rs("login_times") session.timeout=60 Pre_url=request.servervariables("HTTP_REFERER") response.redirect Pre_url else response.write "" end if else response.write "" end if else response.write "" end if end if end if %> <% if request("type")="exit" then response.cookies("username").expires=date()-1 session("common_name")="" session("common_id")="" Pre_url=request.servervariables("HTTP_REFERER") response.redirect Pre_url end if %>